package com.alinesno.cloud.base.logger.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alinesno.cloud.common.core.constants.SpringInstanceScope;
import com.alinesno.cloud.common.core.monitor.Server;

/**
 * 控制层
 * @author WeiXiaoJin
 * @since 2018年11月27日 上午6:41:40
 */
@Controller
@RequestMapping("base/logger")
@Scope(SpringInstanceScope.PROTOTYPE)
public class DashboardController {

	@SuppressWarnings("unused")
	private static final Logger log = LoggerFactory.getLogger(DashboardController.class) ; 
	
	/**
	 * 基础面板  
	 * @param mmap
	 * @return
	 * @throws Exception
	 */
	@GetMapping("/home")
	public String home(Model model) throws Exception {
		
		long fileCount = 12 ; //storageFileService.count() ; 
		long requestCount = 43 ; //requestService.count() ;
		
		model.addAttribute("fileCount", fileCount) ; 
		model.addAttribute("requestCount", requestCount) ; 
		
		Server server = new Server();
		server.copyTo();
		model.addAttribute("server", server);
	
		return "base/logger/home" ; 
	}
	
	
}
